package com.eastcom.bm.atom;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Embeddable;

public class CollectMonitorPK implements Serializable{

	private String taskid;
	private String hostIp;
	private Date collectStart;
	
	public String getTaskid() {
		return taskid;
	}
	public void setTaskid(String taskid) {
		this.taskid = taskid;
	}
	public String getHostIp() {
		return hostIp;
	}
	public void setHostIp(String hostIp) {
		this.hostIp = hostIp;
	}
	public Date getCollectStart() {
		return collectStart;
	}
	public void setCollectStart(Date collectStart) {
		this.collectStart = collectStart;
	}
	
	@Override
	public int hashCode()
	{
		return this.taskid.hashCode()+this.hostIp.hashCode()+this.collectStart.hashCode();
	}
	
	@Override
	public boolean equals(Object o)
	{
		if(o==null)
			return false;
		if(!(o instanceof CollectMonitorPK))
			return false;
		CollectMonitorPK pk=(CollectMonitorPK)o;
		if(pk.getTaskid().equals(this.taskid)&&pk.getHostIp().equals(this.hostIp)
				&&pk.getCollectStart().equals(this.collectStart)){
			return true;
		}else{
			return false;
		}
	}
}
